package com.cmc.cloud.cmclink.doc.vo.limitrulevo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 禁接规则 Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LimitRuleBaseVO {

    @Schema(description = "ATD ETD  生效日期类型", example = "1")
    @Length(max = 3, message = "{LimitRuleBaseVO.effectiveDateType.length}")
    private String effectiveDateType;

    @Schema(description = "适用阶段")
    @Length(max = 10, message = "{LimitRuleBaseVO.usePeriod.length}")
    private String usePeriod;

    @Schema(description = "生效日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date effictiveDate;

    @Schema(description = "失效日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date expiringDate;

    @Schema(description = "规则名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
    @NotBlank(message = "{LimitRuleBaseVO.ruleName.notblank}")
    @Length(max = 30, message = "{LimitRuleBaseVO.ruleName.length}")
    private String ruleName;

    @Schema(description = "规则类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @NotBlank(message = "{LimitRuleBaseVO.ruleType.notblank}")
    @Length(max = 30, message = "{LimitRuleBaseVO.ruleType.length}")
    private String ruleType;

    @Schema(description = "提示内容")
    @Length(max = 255, message = "{LimitRuleBaseVO.feedbackContent.length}")
    private String feedbackContent;

    @Schema(description = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "{LimitRuleBaseVO.enable.notnull}")
    private Boolean enable;

}
